<?php
/**
 * 后台管理全局配置
 */
class general extends spController
{
    public function __construct()
    {
        $this->setLang('en');
        parent::__construct();
        //检查当前终端是否有ID，没有就新建一个ID
        if (!isset($_COOKIE['_FSESSID']))
        {
            $tmpid = md5(microtime() . rand(1, 9999999999999999999999999)); // GENERATE A RANDOM ID
            setcookie('_FSESSID', $tmpid,time()+LASTTIME,WEBDIR);
        }
        $msgurl = $_SERVER["REQUEST_URI"];
        Savelog($msgurl);
    }
    function template()
    {
        $dir = DIR_FS_CATALOG_TEMPLATES;
        if ($handle = opendir($dir)) {
            while (1) {
                $file = readdir($handle);
                if ($file == "")
                    break;
                if (pathinfo($file, PATHINFO_EXTENSION) == 'php') {
                    require (DIR_FS_CATALOG_TEMPLATES . $file);
                    $template_info[$template_name] = array('name' => $template_name, 'version' => $template_version,
                        'author' => $template_author, 'description' => $template_description,
                        'screenshot' => $template_screenshot);
                }
            }
            return $template_info;
        }
    }
}